User defined output/input processing callback function.
| DWORD CALLBACK WASAPIPROC( void *buffer, DWORD length, void *user ); |
Parameters
| buffer | Pointer to the buffer to put the sample data for an output device, or to get the data from an input device. The sample data is always 32-bit floating-point. |
| length | The number of bytes to process. |
| user | The user instance data given when BASS_WASAPI_Init was called. |
Return value
In the case of an output device, the number of bytes written to the buffer. In the case of an input device, 0 = stop the device, else continue.
Remarks
An output/input processing function should obviously be as quick as possible, to avoid buffer underruns (output) or overruns (input). Using a larger buffer makes that less crucial. BASS_WASAPI_GetData (BASS_DATA_AVAILABLE) can be used to check how much data is buffered.
An output device's WASAPIPROC may return less data than requested, but be careful not to do so by too much, too often. If the buffer gets exhausted, output will stall until more data is provided. If you do return less than the requested amount of data, the number of bytes should still equate to a whole number of samples.
Do not call BASS_WASAPI_Free from within a callback function.
See also
BASS_WASAPI_Init, BASS_WASAPI_PutData